package com.yznote.cloudesk.file.controller;

import com.yznote.cloudesk.common.Anno.CollectLogs;
import com.yznote.cloudesk.common.codeResult.YResult;
import com.yznote.cloudesk.common.constants.ModuleConstant;
import com.yznote.cloudesk.common.pojo.Result;
import com.yznote.cloudesk.compileservice.CompileService;
import com.yznote.cloudesk.file.server.RunService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@Api(tags = "核心编译系统")
@RestController
@RequestMapping("/run")
@CollectLogs(moduleName = ModuleConstant.RUN_MODULE)
public class RunController {
    @Autowired
    RunService runService;
    @RequestMapping("/runCode")
    public Result runCode(@RequestParam("fileId") Long fileId){
        YResult yResult =runService.runFile(fileId);
        return Result.success(yResult);
    }
}
